#ifndef SYMBOLHISTCLIENT_H_
#define SYMBOLHISTCLIENT_H_

#include <OTClient.h>
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp>
#include <vector>

namespace OtfeedExamples
{
    /**
     * Client class used to login and obtain the history of symbols from 
     * otFeed servers. 
     */
    class SymbolHistClient : virtual private boost::noncopyable
    {
    public:
        /**
         * Structure used to request history information from SymbolHistClient.
         */
        struct DataRequest
        {
            //! Name of the OpenTick server to use.
            std::string mOpenTickServer ;
            //! Server port to be used.
            unsigned int mOpenTickServerPort ;
            //! Account name used to connect to the server.
            std::string mAccountLogin ;
            //! Password for the above account.
            std::string mAccountPassword ;
            //! Code of the exchange for which data is to be retrieved.
            std::string mExchangeCode ;
            //! Symbol for which data is to be retrived.
            std::string mSymbol ;
            //! Start date for the history data.
            std::string mFromDate ;
            //! End date for the history data.
            std::string mToDate ;
            //! Flag to enable verbose messages.
            bool mIsVerbose ;
            /**
             * Name of the output file. The tick data will be written to this
             * file. 
             */
            std::string mOutputFileName ;
            /**
             * Column separator to be used while writing data to the
             * output file. Using a string here instead of just a
             * character allows a little more flexibility.
             */
            std::string mColumnSeparator ;
        } ;

        /**
         * Default constructor.
         */
        SymbolHistClient() ;
        
        //! Destructor
        ~SymbolHistClient() ;

        /**
         * Requested historical data and write it to the output file specified
         * in dataRequest.
         */
        void
        GetHistData( const DataRequest& dataRequest ) ;
    private:
        //
        // Forward declaration of the implementation class.
        //
        class Implementation ;
        //
        // Pointer to the implementation (we are using the pImpl idiom here)
        //
        boost::scoped_ptr<Implementation> mImpl ;
    } ;
}
#endif /*SYMBOLHISTCLIENT_H_*/
